package man4j;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class MainMIDlet extends MIDlet {
	private MainScreen mainScreen;
	
	private CommonTaskScreen commonTaskScreen;
	
	private CurrentTaskScreen currentTaskScreen;
	
	private GoScreen goScreen;
	
	protected void startApp() throws MIDletStateChangeException {
		if (Display.getDisplay(this).getCurrent() == null) {
			mainScreen = new MainScreen(this);
			
			commonTaskScreen = new CommonTaskScreen(this);
			currentTaskScreen = new CurrentTaskScreen(this);
			goScreen = new GoScreen(this);
			
			commonTaskScreen.loadTasks();
			currentTaskScreen.loadTasks();
	        	        
	        Display.getDisplay(this).setCurrent(mainScreen);
		}
	}
	
	public MainScreen getMainScreen() {
		return mainScreen;
	}
	
	public CommonTaskScreen getCommonTasksScreen() {
		return commonTaskScreen;
	}
	
	public CurrentTaskScreen getCurrentTasksScreen() {
		return currentTaskScreen;
	}

	public GoScreen getGoScreen() {
		return goScreen;
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException { /*empty*/ }
	
	protected void pauseApp() { /* empty*/ }
}
